package com.zhou.common.mybatis.template.shiro.config;

import okhttp3.OkHttpClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.TimeUnit;

/**
 * @author li.ke
 * @date 2021/4/9
 */
@Configuration
public class OkHttpConfig {
    @Bean
    public OkHttpClient getOkHttpClient() {
        return new OkHttpClient.Builder()
        .connectTimeout(30, TimeUnit.SECONDS)
        .readTimeout(30, TimeUnit.SECONDS)
        .followRedirects(false)
        .build();
    }
}
